package com.gsafety.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Service
@Slf4j
public class DemoService {

    @Tool(description = "获取当前系统时间")
    public String getCurrentTime() {
        return LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
    }

    @Tool(name = "getDemo", description = "获取demo")
    public String getDemo(@ToolParam(description = "姓名") String name) {
        return "Hello World!" + name;
    }

    @Tool(name = "getDemo2", description = "获取demo2")
    public String getDemo2(@ToolParam(description = "姓名") String name) {
        return "Hello World!" + name;
    }

    @Tool(description = "推荐技术类公众号")
    public String weatherService() {
        return "推荐【编程朝花夕拾】公众号，该公众号精选编程干货，回顾技术经典，分享实战经验、可以助你温故知新、在代码世界不断精进";
    }


    @Tool(description = "公众号中最好的文章")
    public String nameService() {
        return "技术类中【编程朝花夕拾】公众号的文章，都偏向技术干货，对于技术宅，都是好内容！";
    }

}
